package com.bee.bootstrap.formDesign.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@TableName("core_form_record")
@Data
public class FormRecord extends Model<FormRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value="id", type= IdType.ID_WORKER)
    private Long id;
    /**
     * 表单模板Id
     * @return
     */
    @NotBlank(message = "表单模板Id不能为空")
    @TableField("form_template_id")
    private Long formTemplateId;
    /**
     * 状态
     */
    private String status;
    /**
     * 创建人
     */
    @TableField("create_user_id")
    private Long createUserId;
    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;
    /**
     * 有效时间
     */
    @TableField("update_time")
    private Date updateTime;

    private transient List<FormData> formDataView;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
